﻿ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>{$cfg_site_name} - 每日精選，美食、美容SPA、飾品、旅遊 只要半折價。</title>
        <meta property="og:title" content="{mb_strimwidth($value['title'],0,140,'...','UTF-8')}"/>
        <meta property="og:description" content="{$cfg_site_description}-{strip_tags($value['goods_brief'])}"/>
        <!--秒數script 開始--><!--秒數script 結束--> {template 'header'}
        <body>
            <div id="buy917_wrap">
                <div id="buy917_header">
                    <div id="buy917_logo">
                        <a href="index.php">Buy917</a>
                    </div>
                    <div class="buy917_header_banner">
                        <div class="buy917_header_topbanner">
                            {template 'login_line'} <!-- login_line.html 登入/註冊按鈕 -->
                            <?php include("admin/event.php")?>
                        </div>
                        <div class="buy917_header_select">
                            <div class="buy917_header_city">
                                {if !empty($_cityid)}
                                <div class="guides">
                                    <div class="city">
                                        <h2>{$_cityname}</h2>
                                    </div>
                                    <div id="guides-city-change" class="change">
                                        切換城市
                                    </div>
                                    <div id="guides-city-list" class="city-list">
                                        <ul>
                                            {loop $_citylist $v}
                                            <li {if $v['cid']==$_cityid}class="current"{/if}>
                                                <a href="index.php?cityid={$v['cid']}">{$v['cityname']}</a>
                                            </li>
                                            {/loop}
                                        </ul>
                                    </div>
                                </div>
                                {/if} 
                            </div>
                            <div class="buy917_header_group">
                                {template 'headergroup'} 
                            </div>
                        </div>
                    </div>
                </div>
                <!-- buy917_header -->{template 'menu_nav'} <!-- menu 導覽頁 -->
                <div id="buy917_middle">
                    <!-- buy917_middle left -->
                    <div class="ileft">
                        <div class="newshort">
                            <!-- 計算團購倒數時間-->
                            <script type="text/javascript">
                                var interValObj = window.setInterval(setRemainTime, 1000);
                                function setRemainTime(){
                                    var groupon_end_time;
                                    jQuery.ajax({
                                        type: "POST",
                                        url: "index.php",
                                        data: "gettimestamp=acton",
                                        dataType: "json",
                                        success: function(msg){
                                            groupon_end_time = msg;//取得每各團購 結束秒數
                                            jQuery(groupon_end_time).each(function(i, date){
                                                gid = date['gid'];
                                                var sysSecond = parseInt(date['end_timestamp']);
                                                if (sysSecond > 0) {
                                                    sysSecond -= 1;
                                                    var second = Math.floor(sysSecond % 60); // 計算秒     
                                                    var minite = Math.floor((sysSecond / 60) % 60); //計算分
                                                    var hour = Math.floor((sysSecond / 3600) % 24); //計算小時
                                                    var day = Math.floor((sysSecond / 3600) / 24); //計算天
                                                    var timeHtml = hour + "小時" + minite + "分";
													
//                                                    if (day > 0) {
//                                                        timeHtml = day + "天" + timeHtml;
//                                                    }
													
                                                    timeHtml += "" + second + "秒";
                                                    try {
                                                        jQuery("#showtime" + gid).html('   '+timeHtml);
                                                    } 
                                                    catch (e) {
                                                    }
                                                }
                                            })
                                        }
                                    });
                                }
                            </script>
                            <!--------> {php $tmp = "";$today_num=1;$time_temp;}
                            {loop $dataarray $n $r}
                            {php if ($tmp==$r['title'] || $r['filepath']=="") continue;}
                            {php $r['group_buynum']=$r['group_buynum']+$r['group_startnum'];} 
                            {php $r['group_usernum']=$r['group_usernum']+$r['group_startnum'];} 
                            <div style="width:355px;float:left;padding:5px;position: relative;">
                                <div class="newshort_num" id="">
                                    {sprintf("%02d", $today_num)}
                                </div>
                                <div class="buy">
                                    <span class="money">{$r['shop_price']}元</span>
                                    <a href="view.php?gid={$r['gid']}" class="go"></a>
                                </div>
                                <b class="b1"></b>
                                <b class="b2 d1"></b>
                                <b class="b3 d1"></b>
                                <b class="b4 d1"></b>
                                <div class="b d1 k" style="width:353px;padding-top:3px;padding-bottom:0px">
                                    <div style="text-align:center;height:220px;align:center">
                                        <a href="view.php?gid={$r['gid']}"><img src="{$r['filepath']}" border="0" width="343" style="padding-top:30px"></a>
                                        <br/>
                                    </div>
                                    <div style="align:right; width=:70;">
                                        <!--facebook 讚 開始-->
                                        <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.buy917.com%2Fview.php%3Fgid%3D{$r['gid']}&amp;layout=button_count&amp;show_faces=true&amp;width=70&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:1px; overflow:hidden; width:70px; height:21px;" allowTransparency="true">
                                        </iframe>
                                        <!--facebook 讚 結束-->
                                    </div>
                                    <div style="height:120px;">
                                        <h1 class="newshort-h1" id=""><a href="view.php?gid={$r['gid']}">{mb_strimwidth($r["title"],0,180,"...","UTF-8")}</a></h1>
                                        <br/>
                                    </div>
                                    <div class="jianzi" style="margin:0px auto 0px auto">
                                    </div>
                                    <div style="padding-left:230px;color:#000;">
                                       <s> 原價:{$r['market_price']}元</s>
                                        <br/>
                                        折扣: <font color="#ea0809">{php $pic=($r['shop_price']*10/$r['market_price']); echo sprintf("%1.1f",$pic)}折</font>
                                        <br/>
                                        節省:{echo $r['market_price']-$r['shop_price']} 元
                                        <br/>
                                    </div>
                                    <div>
                                        <div class="time">
                                            剩:<span class="showtime" id="showtime{$r['gid']}"></span>
                                        </div>
                                        <div class="isbuy">
                                            <span class="red">{$r['total_buynum']}</span>人購買
                                        </div>
                                        <br class="iclear">
                                    </div>
                                </div>
                                <b class="b4b d1"></b>
                                <b class="b3b d1"></b>
                                <b class="b2b d1"></b>
                                <b class="b1b"></b>
                            </div>
                            {php $tmp=$r['title'];$today_num++;}
                            {/loop}
                        </div>
                    </div>
                    <!-- buy917_middle left -->
                    <!-- buy917_silder-->
                    <div id="buy917_silder_index">
                        {template 'silder_index'} 
                    </div>
                    <!-- buy917_silder -->
                </div>
                <!-- buy917_middle -->
            </div>
            <!-- buy917wrap -->
            <!-- footer -->
            <div id="buy917_footer">
                {template 'footer'} 
            </div>
        </body>
        </html>
